import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/msg_new_service_entity.dart';

MsgNewServiceEntity $MsgNewServiceEntityFromJson(Map<String, dynamic> json) {
  final MsgNewServiceEntity msgNewServiceEntity = MsgNewServiceEntity();
  final int? code = jsonConvert.convert<int>(json['Code']);
  if (code != null) {
    msgNewServiceEntity.code = code;
  }
  final List<MsgNewServiceData>? data = (json['Data'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<MsgNewServiceData>(e) as MsgNewServiceData)
      .toList();
  if (data != null) {
    msgNewServiceEntity.data = data;
  }
  final String? msg = jsonConvert.convert<String>(json['Msg']);
  if (msg != null) {
    msgNewServiceEntity.msg = msg;
  }
  return msgNewServiceEntity;
}

Map<String, dynamic> $MsgNewServiceEntityToJson(MsgNewServiceEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Code'] = entity.code;
  data['Data'] = entity.data.map((v) => v.toJson()).toList();
  data['Msg'] = entity.msg;
  return data;
}

extension MsgNewServiceEntityExtension on MsgNewServiceEntity {
  MsgNewServiceEntity copyWith({
    int? code,
    List<MsgNewServiceData>? data,
    String? msg,
  }) {
    return MsgNewServiceEntity()
      ..code = code ?? this.code
      ..data = data ?? this.data
      ..msg = msg ?? this.msg;
  }
}

MsgNewServiceData $MsgNewServiceDataFromJson(Map<String, dynamic> json) {
  final MsgNewServiceData msgNewServiceData = MsgNewServiceData();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    msgNewServiceData.id = id;
  }
  final String? account = jsonConvert.convert<String>(json['account']);
  if (account != null) {
    msgNewServiceData.account = account;
  }
  final String? token = jsonConvert.convert<String>(json['token']);
  if (token != null) {
    msgNewServiceData.token = token;
  }
  final String? scena = jsonConvert.convert<String>(json['scena']);
  if (scena != null) {
    msgNewServiceData.scena = scena;
  }
  final int? isUse = jsonConvert.convert<int>(json['is_use']);
  if (isUse != null) {
    msgNewServiceData.isUse = isUse;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    msgNewServiceData.nickname = nickname;
  }
  final String? photo = jsonConvert.convert<String>(json['photo']);
  if (photo != null) {
    msgNewServiceData.photo = photo;
  }
  final String? plat = jsonConvert.convert<String>(json['plat']);
  if (plat != null) {
    msgNewServiceData.plat = plat;
  }
  final String? groupsT = jsonConvert.convert<String>(json['groups_t']);
  if (groupsT != null) {
    msgNewServiceData.groupsT = groupsT;
  }
  final String? groupsTh = jsonConvert.convert<String>(json['groups_th']);
  if (groupsTh != null) {
    msgNewServiceData.groupsTh = groupsTh;
  }
  final int? isRest = jsonConvert.convert<int>(json['is_rest']);
  if (isRest != null) {
    msgNewServiceData.isRest = isRest;
  }
  final int? orderId = jsonConvert.convert<int>(json['order_id']);
  if (orderId != null) {
    msgNewServiceData.orderId = orderId;
  }
  final int? isHidden = jsonConvert.convert<int>(json['is_hidden']);
  if (isHidden != null) {
    msgNewServiceData.isHidden = isHidden;
  }
  return msgNewServiceData;
}

Map<String, dynamic> $MsgNewServiceDataToJson(MsgNewServiceData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['account'] = entity.account;
  data['token'] = entity.token;
  data['scena'] = entity.scena;
  data['is_use'] = entity.isUse;
  data['nickname'] = entity.nickname;
  data['photo'] = entity.photo;
  data['plat'] = entity.plat;
  data['groups_t'] = entity.groupsT;
  data['groups_th'] = entity.groupsTh;
  data['is_rest'] = entity.isRest;
  data['order_id'] = entity.orderId;
  data['is_hidden'] = entity.isHidden;
  return data;
}

extension MsgNewServiceDataExtension on MsgNewServiceData {
  MsgNewServiceData copyWith({
    int? id,
    String? account,
    String? token,
    String? scena,
    int? isUse,
    String? nickname,
    String? photo,
    String? plat,
    String? groupsT,
    String? groupsTh,
    int? isRest,
    int? orderId,
    int? isHidden,
  }) {
    return MsgNewServiceData()
      ..id = id ?? this.id
      ..account = account ?? this.account
      ..token = token ?? this.token
      ..scena = scena ?? this.scena
      ..isUse = isUse ?? this.isUse
      ..nickname = nickname ?? this.nickname
      ..photo = photo ?? this.photo
      ..plat = plat ?? this.plat
      ..groupsT = groupsT ?? this.groupsT
      ..groupsTh = groupsTh ?? this.groupsTh
      ..isRest = isRest ?? this.isRest
      ..orderId = orderId ?? this.orderId
      ..isHidden = isHidden ?? this.isHidden;
  }
}